package homework;

import java.util.*;

//Main class
public class main {
      //main function
      public static void main(String args[]){
              //Calling calculator
              Calculator Cal = new Calculator();
              //User Dialogue
              System.out.println("1.sum");
              System.out.println("2.sub");
              System.out.println("3.times");
              System.out.println("4.divide");
              System.out.println("5.average");
              System.out.println("6.max");
              System.out.println("7.min");
              System.out.println("8.power");
              System.out.println("9.median");
              System.out.println("10.range");
              System.out.println("Choose one function ! (1-9)");
              //Choosing one of the operations
              Scanner scanner = new Scanner(System.in);
              int chosen = scanner.nextInt();
              switch(chosen){
              //Sum option
              case 1:
                      System.out.println("Please Input Three numbers!");
                      try {
                              //Input Values
                              int a = scanner.nextInt();
                              int b = scanner.nextInt();
                              int c = scanner.nextInt();
                              //Calling Operation
                              int result = Cal.sum(a, b, c);
                              System.out.println("The result is :" +result);
                      } 
                      finally{
                              
                      }
                      break;
              //Substration option
              case 2:
                      try {
                              System.out.println("Please Input Three numbers!");
                              //Input values
                              int a = scanner.nextInt();
                              int b = scanner.nextInt();
                              int c = scanner.nextInt();
                              //Calling operation
                              int result = Cal.minus(a, b, c);
                              //Printing Result
                              System.out.println("The result is :" +result);
                      } 
                      finally{
                              
                      }
                      break;
              //Multiply option
              case 3:
                      try {
                              System.out.println("Please Input Three numbers!");
                              //Input values
                              int a = scanner.nextInt();
                              int b = scanner.nextInt();
                              int c = scanner.nextInt();
                              //Calling operation
                              int result = Cal.times(a, b, c);
                              //Printing Result
                              System.out.println("The result is :" +result);
                      } 
                      finally{
                              
                      }
                      break;
              //Division option
              case 4:
                      try {
                              System.out.println("Please Input Three numbers!");
                              //Input values
                              int a = scanner.nextInt();
                              int b = scanner.nextInt();
                              int c = scanner.nextInt();
                              //Calling operation
                              int result = Cal.divide(a, b, c);
                              //Printing Result
                              System.out.println("The result is :" +result);
                      }
                      finally{
                              
                      }
                      break;
              //Average Value option
              case 5:
                      try {
                              System.out.println("Please Input Three numbers!");
                              //Input values
                              int a = scanner.nextInt();
                              int b = scanner.nextInt();
                              int c = scanner.nextInt();
                              //Calling operation
                              int result = Cal.average(a, b, c);
                              //Printing Result
                              System.out.println("The result is :" +result);
                      } 
                      finally{
                              
                      }
                      break;
              //Maximum Value option
              case 6:
                      try {
                              System.out.println("Please Input Three numbers!");
                              //Input values
                              int a = scanner.nextInt();
                              int b = scanner.nextInt();
                              int c = scanner.nextInt();
                              //Calling operation
                              int result = Cal.max(a, b, c);
                              //Printing Result
                              System.out.println("The result is :" +result);
                      } 
                      finally{
                              
                      }
                      break;
              //Minimum Value option
              case 7:
                      try {
                              System.out.println("Please Input Three numbers!");
                              //Input values
                              int a = scanner.nextInt();
                              int b = scanner.nextInt();
                              int c = scanner.nextInt();
                              //Calling operation
                              int result = Cal.min(a, b, c);
                              //Printing Result
                              System.out.println("The result is :" +result);
                      } 
                      finally{
                              
                      }
                      break;
              //Two Values Power option
              case 8:
                      try {
                              System.out.println("Please Input Two numbers!");
                              //Input values
                              int a = scanner.nextInt();
                              int b = scanner.nextInt();
                              //Calling operation
                              int result = Cal.power(a, b);
                              //Printing Result
                              System.out.println("The result is :" +result);
                      } 
                      finally{
                              
                      }
                      break;
              //Median Option
              case 9:
                      try {
                              System.out.println("Please Input Three numbers!");
                              //Input values
                              int a = scanner.nextInt();
                              int b = scanner.nextInt();
                              int c = scanner.nextInt();
                              //Calling operation
                              int result = Cal.median(a, b, c);
                              //Printing Result
                              System.out.println("The result is :" +result);
                      } 
                      finally{
                              
                      }
                      break;
              //Range Option
              case 10:
                      try {
                              System.out.println("Please Input Three numbers!");
                              //Input values
                              int a = scanner.nextInt();
                              int b = scanner.nextInt();
                              int c = scanner.nextInt();
                              //Calling operation
                              int result = Cal.range(a, b, c);
                              //Printing Result
                              System.out.println("The result is :" +result);
                      } 
                      finally{
                              
                      }
                      break;
              }
      }
}